﻿using Reckoning;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace TestReckoning
{
    
    
    /// <summary>
    ///This is a test class for CountOptionsTest and is intended
    ///to contain all CountOptionsTest Unit Tests
    ///</summary>
    [TestClass()]
    public class CountOptionsTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        /// Construct an empty object
        /// </summary>
        /// <returns>The object</returns>
        private CountOptions MakeObject()
        {
            bool doStemming = false;
            bool useStopWords = false;
            HashSet<StopWordInfo> stopWords = null;
            uint topNThresh = 0;
            uint percentThresh = 0;
            bool useReferenceFile = false;
            string referenceFilePath = string.Empty;
            CountOptions target = new CountOptions(doStemming, useStopWords, stopWords, topNThresh, percentThresh, useReferenceFile, referenceFilePath);

            return target;
        }

        /// <summary>
        ///A test for CountOptions Constructor
        ///</summary>
        [TestMethod()]
        public void CountOptionsConstructorTest()
        {
            CountOptions target = MakeObject();            
            Assert.IsNotNull(target);
        }

        /// <summary>
        ///A test for DoStemming
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void DoStemmingTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0);
            bool expected = true; 
            bool actual;
            target.DoStemming = expected;
            actual = target.DoStemming;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for PercentThresh
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void PercentThreshTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0);
            uint expected = 10; 
            uint actual;
            target.PercentThresh = expected;
            actual = target.PercentThresh;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for ReferenceFilePath
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void ReferenceFilePathTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0);
            string expected = "C:/whatever"; 
            string actual;
            target.ReferenceFilePath = expected;
            actual = target.ReferenceFilePath;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for StopWords
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void StopWordsTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0);
            HashSet<StopWordInfo> expected = new HashSet<StopWordInfo>();
            expected.Add(new StopWordInfo("Hello"));
            expected.Add(new StopWordInfo("Goodbye"));
            HashSet<StopWordInfo> actual;
            target.StopWords = expected;
            actual = target.StopWords;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for TopNThresh
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void TopNThreshTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0);
            uint expected = 15; 
            uint actual;
            target.TopNThresh = expected;
            actual = target.TopNThresh;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for UseReferenceFile
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void UseReferenceFileTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0);
            bool expected = true;
            bool actual;
            target.UseReferenceFile = expected;
            actual = target.UseReferenceFile;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for UseStopWords
        ///</summary>
        [TestMethod()]
        [DeploymentItem("Reckoning.exe")]
        public void UseStopWordsTest()
        {
            PrivateObject param0 = new PrivateObject(MakeObject()); 
            CountOptions_Accessor target = new CountOptions_Accessor(param0); 
            bool expected = true; 
            bool actual;
            target.UseStopWords = expected;
            actual = target.UseStopWords;
            Assert.AreEqual(expected, actual);            
        }
    }
}
